package com.cherish.demo.db.entity;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * @ClassName
 * @Author cherish
 * @Date 2019/11/28
 * @Description
 * 实体类需要指定表名和主键
 * 否则会报如下错误
 * Error while adding the mapper 'interface com.cherish.demo.db.mapper.TestMapper' to configuration.
 * java.lang.NullPointerException: null
 *
 *
 *
 */
@Data
@TableName("test")
public class Test {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private String hashcode;
    private Integer random;
    private String description;
    private Date createTime;
    private Date updateTime;

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

}
